The present invention relates to an image processing apparatus for executing anti-aliasing processing to remove the jagged portion of the edge of an output image and, more particularly, an image processing apparatus for rendering a triangular region surrounded with a vector image edge by obtaining the area of the triangular region in units of pixels overlapping the triangular region and performing rendering processing for the triangular region in units of pixels on the basis of the obtained area.
A conventional image processing apparatus for a 3D graphics technique of displaying a triangle performs rendering processing as follows.
First of all, a polygonal primitive is formed by using pieces of vertex unit information, i.e., X- and Y-coordinates, the slopes of sides with respect to sub-spans, and color value information. The color value and color incremental value of the start point of each span parallel to the X-axis are calculated on the basis of the X- and Y-coordinates of the vertexes of this polygonal primitive and the slopes of the respective sides. The color of each pixel within this span is interpolated in units of spans by using the color value and color incremental value of the start point of the span. The resultant color value of each pixel is stored in a frame buffer. The contents of this frame buffer are then displayed.
When the image data generated by this rendering processing is displayed on the screen, jaggies (jagged edge) appear, which become more noticeable as edge portions become horizontal or vertical. Such jaggies appear because of an attempt to render an ideal edge with a series of pixels arranged on a pixel grid.
This state of jaggies is called aliasing, and a technique of reducing such jaggies is called anti-aliasing. As an anti-aliasing method, the uniform averaging method disclosed in Japanese Patent Laid-Open No. 4-158061 is available. In this method, each pixel (picture element) is divided into N.times.M (N and M are natural numbers) sub-pixels, and raster calculation is performed with a high resolution. Thereafter, the luminance of each pixel is obtained by averaging the luminances of N.times.M sub-pixels.
The image processing apparatus disclosed in Japanese Patent Laid-Open No. 6-68271 is designed to execute anti-aliasing processing by using this uniform averaging method. In this apparatus, one pixel is divided into 16 sub-pixels, and one line is divided into four sub-lines. The intersections of the respective sub-lines and vectors are obtained. The sub-pixels between the intersections are painted in units of sub-lines, thereby painting 1-line pixels. Thereafter, the number of painted sub-pixels is counted in units of 1-line pixels to obtain the area of the region surrounded with the edge. The luminance of each pixel is determined in accordance with this area.
In the image processing apparatus disclosed in Japanese Patent Laid-Open No. 6-68271, however, since painting is performed in units of sub-lines, the processing speed is low.